package abs.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class GlobalConfig {
    //全局变量
    //python执行程序目录
    private static String pythonExePath;
    //textRank.py文件的目录（必须用绝对路径）
    private static String textRankFilePath;
    //mmr.py文件的目录（必须用绝对路径）
    private static String mmrFilePath;
    //stopWord.text文件路径
    private static String stopWordPath;
    //word2vec.py文件的目录（必须用绝对路径）
    private static String word2vecPath;
    //讯飞appId
    private static String appId;
    //语音读取
    private static String SECRET_KEY;
    //文字识别
    private static String API_KEY;
    //oss endpoint
    private static String endpoint;
    //oss accessKeyId
    private static String accessKeyId;
    //oss accessKeySecret
    private static String accessKeySecret;
    //oss bucket
    private static String bucket;
    //oss contents
    private static String contents;
    //临时文件路径
    private static String tempFilePath;

    @Value("${aliyun.oss.localTempFilePath}")
    public void setTempFilePath(String tempFilePath) {
        GlobalConfig.tempFilePath = tempFilePath;
    }

    @Value("${aliyun.oss.endpoint}")
    public void setEndpoint(String endpoint) {
        GlobalConfig.endpoint = endpoint;
    }

    @Value("${aliyun.oss.accessKeyId}")
    public void setAccessKeyId(String accessKeyId) {
        GlobalConfig.accessKeyId = accessKeyId;
    }

    @Value("${aliyun.oss.accessKeySecret}")
    public void setAccessKeySecret(String accessKeySecret) {
        GlobalConfig.accessKeySecret = accessKeySecret;
    }

    @Value("${aliyun.oss.bucket}")
    public void setBucket(String bucket) {
        GlobalConfig.bucket = bucket;
    }

    @Value("${aliyun.oss.contents}")
    public void setContents(String contents) {
        GlobalConfig.contents = contents;
    }

    @Value("${xunfei.word.API_KEY}")
    public void setApiKey(String apiKey) {
        API_KEY = apiKey;
    }

    @Value("${xunfei.APPID}")
    public void setAppId(String appId) {
        GlobalConfig.appId = appId;
    }

    @Value("${xunfei.audio.SECRET_KEY}")
    public void setSecretKey(String secretKey) {
        SECRET_KEY = secretKey;
    }

    @Value("${path.word2vec}")
    public void setWord2vecPath(String word2vecPath) {
        GlobalConfig.word2vecPath = word2vecPath;
    }

    @Value("${path.python}")
    public void setPythonExePath(String pythonExePath) {
        GlobalConfig.pythonExePath = pythonExePath;
    }

    @Value("${path.textRank}")
    public void setTextRankFilePath(String textRankFilePath) {
        GlobalConfig.textRankFilePath = textRankFilePath;
    }

    @Value("${path.mmr}")
    public void setMmrFilePath(String mmrFilePath) {
        GlobalConfig.mmrFilePath = mmrFilePath;
    }

    @Value("${path.stopWord}")
    public void setStopWordPath(String stopWordPath) {
        GlobalConfig.stopWordPath = stopWordPath;
    }

    public static String getPythonExePath() {
        return pythonExePath;
    }

    public static String getTextRankFilePath() {
        return textRankFilePath;
    }

    public static String getMmrFilePath() {
        return mmrFilePath;
    }

    public static String getStopWordPath() {
        return stopWordPath;
    }

    public static String getWord2vecPath() {
        return word2vecPath;
    }

    public static String getAppId() {
        return appId;
    }

    public static String getSecretKey() {
        return SECRET_KEY;
    }

    public static String getApiKey() {
        return API_KEY;
    }

    public static String getEndpoint() {
        return endpoint;
    }

    public static String getContents() {
        return contents;
    }

    public static String getBucket() {
        return bucket;
    }

    public static String getAccessKeySecret() {
        return accessKeySecret;
    }

    public static String getAccessKeyId() {
        return accessKeyId;
    }

    public static String getTempFilePath() {
        return tempFilePath;
    }
}
